const Client = require('./client');

const main = async ()=> {
    let nodeUrl1 = "https://rpc.kava-rpc.com";
    let nodeUrl2 = "https://rpc.kava.io";

    let client = new Client(nodeUrl1);
    await client.getClient();
	console.log('------------------- getHeight -------------------');
	let height = await client.getBlockNumberSync();

    console.log('height: ', height);

    console.log('---------------- getblock ---------------------');

    let preBlock = 10000;//16018597-1003;// 15656000; //height/3; // - height /2; 100005; 16018597
    console.log('preBlock: ', preBlock);
   let block = await client.getBlock(preBlock);
   console.log('block: ', block);

    console.log('--------------- getTx -------------------');
    try{
        let ret = await client.getTx('E29D7A8A3A1CEB3094E877438E651AB5D693CFBC12956C192C7687058E8ADCB4');
        
    }catch(e) {
        console.log("getTx, e: ",e);
    }
   
}
main();
